package com.bwie.task;

import com.bwie.domain.TbCoupon;
import com.bwie.domain.TbUser;
import com.bwie.mapper.TbCouponMapper;
import com.bwie.mapper.TbUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author : xiaogao
 * @date : 2024-11-21 18:32
 * @description :
 **/
@Component
public class CouponExpireTask {

    @Autowired
    TbUserMapper tbUserMapper;

    @Autowired
    TbCouponMapper tbCouponMapper;

    /*@Scheduled(cron = "0 0/1 * * * ?")
    public void checkCouponExpire(){
        System.out.println("优惠券是否过期检查");
        List<TbCoupon> expireList = tbCouponMapper.getExpireList();
        for (TbCoupon tbCoupon : expireList) {

            tbCoupon.setExpire(1);
            tbCouponMapper.updateById(tbCoupon);
        }
    }*/
}